USE [BillManage]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Bill_Water](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[FCid] [int] NOT NULL,
	[FName] [varchar](100) NOT NULL,
	[FCName] [varchar](50) NULL,
	[FBillNo] [varchar](50) NOT NULL,
	[FVerifyCode] [varchar](50) NOT NULL,
	[FLRate] [int] NOT NULL,
	[FRate] [int] NOT NULL,
	[FQty] [int] NOT NULL,
	[FPrice] [decimal](18, 2) NOT NULL,
	[FAcc] [decimal](18, 2) NOT NULL,
	[FManageFee] [decimal](18, 2) NOT NULL,
	[FOther] [decimal](18, 2) NOT NULL,
	[FLBalance] [decimal](18, 2) NOT NULL,
	[FCost] [decimal](18, 2) NOT NULL,
	[FAmount] [decimal](18, 2) NOT NULL,
	[FRef] [varchar](50) NULL,
	[FUid] [int] NOT NULL,
	[FUName] [varchar](50) NOT NULL,
	[FVid] [int] NULL,
	[FVName] [varchar](50) NULL,
	[FCancel] [int] NOT NULL,
	[FPCount] [int] NOT NULL,
	[FBCode] [varchar](36),
	[FDate] [datetime] NOT NULL DEFAULT GETDATE(),
	[FRDate] [datetime] NOT NULL DEFAULT GETDATE()
 CONSTRAINT [PK_Bill_Water] PRIMARY KEY CLUSTERED 
(
	[id] ASC,
	[FBillNo] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Bill_Water] ADD  CONSTRAINT [DF_Bill_Water_FManageFee]  DEFAULT ((0)) FOR [FManageFee]
GO

ALTER TABLE [dbo].[Bill_Water] ADD  CONSTRAINT [DF_Bill_Water_FOther]  DEFAULT ((0)) FOR [FOther]
GO

ALTER TABLE [dbo].[Bill_Water] ADD  CONSTRAINT [DF_Bill_Water_FCancel]  DEFAULT ((0)) FOR [FCancel]
GO

ALTER TABLE [dbo].[Bill_Water] ADD  CONSTRAINT [DF_Bill_Water_FPCount]  DEFAULT ((0)) FOR [FPCount]
GO

